% Extract emails from a text file
% Used for extracting emails from WMM survey
% Jan 4, 2011

fid = fopen('/home/mnair/temp/results.txt','rt');
fid_w = fopen('/home/mnair/temp/wmm_email.txt','wt');

while (feof(fid) == 0 ),
s = fscanf(fid,'%s',1);
if  (    ~isempty (strfind(s,'@') ) & isempty (strfind(s,'somewhere.com') ) & isempty (strfind(s,'777-777') ) )    
fprintf(fid_w, '%s\n',s);
end;
end;
fclose all;
